.class Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;
.super Ljava/lang/Object;
.source "ElementWorkspaceSwitcher.java"

# interfaces
.implements Lcom/nemustech/tiffany/world/TFModel$OnTouchListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/nemustech/regina/ElementWorkspaceSwitcher;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/nemustech/regina/ElementWorkspaceSwitcher;


# direct methods
.method constructor <init>(Lcom/nemustech/regina/ElementWorkspaceSwitcher;)V
    .locals 0
    .parameter

    .prologue
    .line 140
    iput-object p1, p0, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;->this$0:Lcom/nemustech/regina/ElementWorkspaceSwitcher;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onLongPressdown(Lcom/nemustech/tiffany/world/TFModel;IFF)Z
    .locals 1
    .parameter "model"
    .parameter "faceIndex"
    .parameter "x"
    .parameter "y"

    .prologue
    .line 211
    const/4 v0, 0x0

    return v0
.end method

.method public onSelected(Lcom/nemustech/tiffany/world/TFModel;IFF)Z
    .locals 1
    .parameter "model"
    .parameter "faceIndex"
    .parameter "x"
    .parameter "y"

    .prologue
    .line 204
    const/4 v0, 0x0

    return v0
.end method

.method public onTouchDown(Lcom/nemustech/tiffany/world/TFModel;IFF)Z
    .locals 1
    .parameter "model"
    .parameter "faceIndex"
    .parameter "x"
    .parameter "y"

    .prologue
    .line 198
    const/4 v0, 0x0

    return v0
.end method

.method public onTouchDrag(Lcom/nemustech/tiffany/world/TFModel;IFFFFI)Z
    .locals 1
    .parameter "model"
    .parameter "faceIndex"
    .parameter "sx"
    .parameter "sy"
    .parameter "ex"
    .parameter "ey"
    .parameter "tickPassed"

    .prologue
    .line 192
    const/4 v0, 0x0

    return v0
.end method

.method public onTouchUp(Lcom/nemustech/tiffany/world/TFModel;IFF)Z
    .locals 8
    .parameter "model"
    .parameter "faceIndex"
    .parameter "x"
    .parameter "y"

    .prologue
    const/4 v7, 0x0

    .line 143
    const/4 v1, 0x0

    .line 144
    .local v1, dlgBuilder:Landroid/app/AlertDialog$Builder;
    iget-object v5, p0, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;->this$0:Lcom/nemustech/regina/ElementWorkspaceSwitcher;

    invoke-static {v5}, Lcom/nemustech/regina/ElementWorkspaceSwitcher;->access$200(Lcom/nemustech/regina/ElementWorkspaceSwitcher;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v5

    invoke-virtual {v5}, Lcom/nemustech/regina/ReginaLauncher;->isSecretMode()Z

    move-result v2

    .line 145
    .local v2, isSecretMode:Z
    iget-object v5, p0, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;->this$0:Lcom/nemustech/regina/ElementWorkspaceSwitcher;

    invoke-static {v5}, Lcom/nemustech/regina/ElementWorkspaceSwitcher;->access$300(Lcom/nemustech/regina/ElementWorkspaceSwitcher;)Lcom/nemustech/regina/ElementLocator;

    move-result-object v5

    invoke-virtual {v5}, Lcom/nemustech/regina/ElementLocator;->getWorkspaceCount()I

    move-result v5

    iget-object v6, p0, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;->this$0:Lcom/nemustech/regina/ElementWorkspaceSwitcher;

    invoke-static {v6}, Lcom/nemustech/regina/ElementWorkspaceSwitcher;->access$200(Lcom/nemustech/regina/ElementWorkspaceSwitcher;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v6

    invoke-virtual {v6}, Lcom/nemustech/regina/ReginaLauncher;->getReginaPref()Lcom/nemustech/regina/ReginaPreference;

    move-result-object v6

    invoke-virtual {v6, v2}, Lcom/nemustech/regina/ReginaPreference;->getWorkspaceMinCount(Z)I

    move-result v6

    if-le v5, v6, :cond_1

    .line 146
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->getParentHolder()Lcom/nemustech/tiffany/world/TFHolder;

    move-result-object v4

    .line 147
    .local v4, workspaceToDelete:Lcom/nemustech/tiffany/world/TFHolder;
    iget-object v5, p0, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;->this$0:Lcom/nemustech/regina/ElementWorkspaceSwitcher;

    invoke-static {v5}, Lcom/nemustech/regina/ElementWorkspaceSwitcher;->access$100(Lcom/nemustech/regina/ElementWorkspaceSwitcher;)Lcom/nemustech/regina/ElementWorkspaceSwitcher$workspaceSwitcherHolder;

    move-result-object v5

    invoke-virtual {v5, v4}, Lcom/nemustech/regina/ElementWorkspaceSwitcher$workspaceSwitcherHolder;->getSlotIndex(Lcom/nemustech/tiffany/world/TFObject;)I

    move-result v3

    .line 148
    .local v3, workspaceIdxToDelete:I
    iget-object v5, p0, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;->this$0:Lcom/nemustech/regina/ElementWorkspaceSwitcher;

    invoke-static {v5}, Lcom/nemustech/regina/ElementWorkspaceSwitcher;->access$300(Lcom/nemustech/regina/ElementWorkspaceSwitcher;)Lcom/nemustech/regina/ElementLocator;

    move-result-object v5

    invoke-virtual {v5, v3}, Lcom/nemustech/regina/ElementLocator;->getWorkspace(I)Lcom/nemustech/regina/RGWorkspace;

    move-result-object v5

    invoke-virtual {v5}, Lcom/nemustech/regina/RGWorkspace;->getElementList()Ljava/util/ArrayList;

    move-result-object v5

    invoke-virtual {v5}, Ljava/util/ArrayList;->size()I

    move-result v5

    if-lez v5, :cond_0

    .line 152
    new-instance v1, Landroid/app/AlertDialog$Builder;

    .end local v1           #dlgBuilder:Landroid/app/AlertDialog$Builder;
    iget-object v5, p0, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;->this$0:Lcom/nemustech/regina/ElementWorkspaceSwitcher;

    invoke-static {v5}, Lcom/nemustech/regina/ElementWorkspaceSwitcher;->access$200(Lcom/nemustech/regina/ElementWorkspaceSwitcher;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v5

    invoke-direct {v1, v5}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    .line 153
    .restart local v1       #dlgBuilder:Landroid/app/AlertDialog$Builder;
    const-string v5, "Warning !!!"

    invoke-virtual {v1, v5}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v5

    const-string v6, "The workspace you are about to delete is not empty. Everything on the workspace will be removed when deleted. Delete workspace?"

    invoke-virtual {v5, v6}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v5

    invoke-virtual {v5, v7}, Landroid/app/AlertDialog$Builder;->setCancelable(Z)Landroid/app/AlertDialog$Builder;

    move-result-object v5

    const-string v6, "Yes"

    new-instance v7, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2$2;

    invoke-direct {v7, p0, v4}, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2$2;-><init>(Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;Lcom/nemustech/tiffany/world/TFHolder;)V

    invoke-virtual {v5, v6, v7}, Landroid/app/AlertDialog$Builder;->setPositiveButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    move-result-object v5

    const-string v6, "No"

    new-instance v7, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2$1;

    invoke-direct {v7, p0}, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2$1;-><init>(Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;)V

    invoke-virtual {v5, v6, v7}, Landroid/app/AlertDialog$Builder;->setNegativeButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    .line 167
    invoke-virtual {v1}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v0

    .line 168
    .local v0, alert:Landroid/app/AlertDialog;
    invoke-virtual {v0}, Landroid/app/AlertDialog;->show()V

    .line 185
    .end local v0           #alert:Landroid/app/AlertDialog;
    .end local v3           #workspaceIdxToDelete:I
    .end local v4           #workspaceToDelete:Lcom/nemustech/tiffany/world/TFHolder;
    :goto_0
    const/4 v5, 0x1

    return v5

    .line 170
    .restart local v3       #workspaceIdxToDelete:I
    .restart local v4       #workspaceToDelete:Lcom/nemustech/tiffany/world/TFHolder;
    :cond_0
    iget-object v5, p0, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;->this$0:Lcom/nemustech/regina/ElementWorkspaceSwitcher;

    invoke-static {v5, v4}, Lcom/nemustech/regina/ElementWorkspaceSwitcher;->access$400(Lcom/nemustech/regina/ElementWorkspaceSwitcher;Lcom/nemustech/tiffany/world/TFHolder;)V

    goto :goto_0

    .line 173
    .end local v3           #workspaceIdxToDelete:I
    .end local v4           #workspaceToDelete:Lcom/nemustech/tiffany/world/TFHolder;
    :cond_1
    new-instance v1, Landroid/app/AlertDialog$Builder;

    .end local v1           #dlgBuilder:Landroid/app/AlertDialog$Builder;
    iget-object v5, p0, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;->this$0:Lcom/nemustech/regina/ElementWorkspaceSwitcher;

    invoke-static {v5}, Lcom/nemustech/regina/ElementWorkspaceSwitcher;->access$200(Lcom/nemustech/regina/ElementWorkspaceSwitcher;)Lcom/nemustech/regina/ReginaLauncher;

    move-result-object v5

    invoke-direct {v1, v5}, Landroid/app/AlertDialog$Builder;-><init>(Landroid/content/Context;)V

    .line 174
    .restart local v1       #dlgBuilder:Landroid/app/AlertDialog$Builder;
    const-string v5, "Error !!!"

    invoke-virtual {v1, v5}, Landroid/app/AlertDialog$Builder;->setTitle(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v5

    const-string v6, "Workspace cannot be removed. You need at least three workspaces."

    invoke-virtual {v5, v6}, Landroid/app/AlertDialog$Builder;->setMessage(Ljava/lang/CharSequence;)Landroid/app/AlertDialog$Builder;

    move-result-object v5

    invoke-virtual {v5, v7}, Landroid/app/AlertDialog$Builder;->setCancelable(Z)Landroid/app/AlertDialog$Builder;

    move-result-object v5

    const-string v6, "OK"

    new-instance v7, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2$3;

    invoke-direct {v7, p0}, Lcom/nemustech/regina/ElementWorkspaceSwitcher$2$3;-><init>(Lcom/nemustech/regina/ElementWorkspaceSwitcher$2;)V

    invoke-virtual {v5, v6, v7}, Landroid/app/AlertDialog$Builder;->setPositiveButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/app/AlertDialog$Builder;

    .line 182
    invoke-virtual {v1}, Landroid/app/AlertDialog$Builder;->create()Landroid/app/AlertDialog;

    move-result-object v0

    .line 183
    .restart local v0       #alert:Landroid/app/AlertDialog;
    invoke-virtual {v0}, Landroid/app/AlertDialog;->show()V

    goto :goto_0
.end method
